/**
 * Created by 邵亚楠 on 2018/9/9.
 */
var sessionId = sessionStorage.getItem('sessionId');
$(function(){
   $('#btn').click(function(){

       var isAudio = ''
       $("input:radio[name='isAudio']:checked").each(function(){
           isAudio = $(this).val()
       })
       var isRead = ''
       $("input:radio[name='isRead']:checked").each(function(){
           isRead = $(this).val()
       })
       var isVideo = ''
       $("input:radio[name='isVideo']:checked").each(function(){
           isVideo = $(this).val()
       })
       var ispurchase = ''
       $("input:radio[name='ispurchase']:checked").each(function(){
           ispurchase = $(this).val()
       })
       $.ajax({
           url:'https://www.bjdeshangyuan.com/book/api/saveQuestion',
           type:'POST',
           data:{'sessionid':sessionId,'listenBook':isAudio,'eBook':isRead,'video':isVideo,'buyBook':ispurchase},
           success:function(r){
               //console.log(r)
               if(r.code==='USR000'){
                   layer.msg('提交成功',{
                       time:1000
                   })
               }

           }
       })


   })

    $('.back').click(function(){
        window.history.back();
    })

})